/*
 * @Description:
 * @Author: Tsingwong
 * @Date: 2020-12-01 19:19:29
 * @LastEditors: Tsingwong
 * @LastEditTime: 2020-12-01 19:22:22
 */
import React, { PureComponent } from 'react'
import { connect } from 'react-redux'
import { Redirect } from 'react-router-dom'

class Write extends PureComponent {
  componentDidMount() {}
  render() {
    const { loginStatus } = this.props
    if (loginStatus) {
      return <div>HelloWorld</div>
    } else {
      return <Redirect to="/login" />
    }
  }
}

const mapStateToProps = (state) => {
  return {
    loginStatus: state.getIn(['login', 'login']),
  }
}

const mapDispatchToProps = {}

export default connect(mapStateToProps, mapDispatchToProps)(Write)
